import * as YvanUI from 'yvan-ui-wotu'

interface Ref {
    t1: YvanUI.Text,
    t2: YvanUI.Text
}

const React = YvanUI.React
const {Card} = YvanUI.Antd
const Observer = YvanUI.Observer
const _ = YvanUI.lodash

export default class Simple2 extends YvanUI.Scope<void, Ref> {

    main = this.$$({
        date: '2020-10-01',
        date2: '',
        dateWeek: '',
        dateMonth: '',
        dateQuarter: '',
        dateYear: ''
    })

    onRender() {
        window['biz'] = this
    }

    vjson = {
        title: '极简-日期',
        items: [
            {
                view: 'form',
                debug: 'main',
                items: [
                    {
                        view: 'date',
                        label: '日期',
                        bind: 'main.date',
                    },
                    {
                        view: 'date',
                        label: '日期',
                        bind: 'main.date2',
                        format: "YYYY-MM-DD HH:mm:ss",
                        showTime: true
                    },
                    {
                        view: 'date',
                        label: '周',
                        bind: 'main.dateWeek',
                        picker: 'week'
                    },
                    {
                        view: 'date',
                        label: '月',
                        bind: 'main.dateMonth',
                        picker: 'month'
                    },
                    {
                        view: 'date',
                        label: '季度',
                        bind: 'main.dateQuarter',
                        picker: 'quarter'
                    },
                    {
                        view: 'date',
                        label: '年',
                        bind: 'main.dateYear',
                        picker: 'year'
                    }
                ]
            }
        ]
    }

}